package com.ding.dailyup.emum;

import com.google.common.collect.Lists;

public enum StrategyStatusEnum {
	FREE(1, ""), TIME_LIMIT(2, "限免"), PAY(3, "收费"), DEL(9, "废弃"), DEFAULT(4,"默认展示");

	private int status;

	private String desc;

	StrategyStatusEnum(int status, String desc) {
		this.status = status;
		this.desc = desc;
	}

	public int status() {
		return status;
	}

	public static String getDesc(int status) {
		for (StrategyStatusEnum value : StrategyStatusEnum.values()) {
			if (value.status == status) {
				return value.desc;
			}
		}
		return "";
	}

	/**
	 * 免费或者限时的, 就是可用的
	 * 
	 * @param statusT
	 * @return
	 */
	public static boolean usable(int statusT) {
		return Lists.newArrayList(FREE.status, TIME_LIMIT.status,DEFAULT.status).contains(statusT);
	}
}
